import request from "@/utils/request";
import type {TransactionDTO, TransactionQueryParams, TransactionRecordVO, WalletInfoVO} from "@/types/pay";

/** 获取钱包信息 */
export const getWalletInfoAPI = () => {
  return request<WalletInfoVO>({
    method: "GET",
    url: "/pay/wallet/walletInfo"
  })
}

/** 分页获取交易记录 */
export const getTransactionRecordByPageAPI = (data: TransactionQueryParams) => {
  return request<TransactionRecordVO[]>({
    method: "GET",
    url: "/pay/transactionRecord/page",
    data
  })
}

/** 充值或提现 */
export const rechargeOrWithdrawalAPI = (data: TransactionDTO) => {
  return request<TransactionRecordVO[]>({
    method: "PUT",
    url: "/pay/wallet/rechargeOrWithdrawal",
    data
  })
}
